<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <!-- 引入bootstarp -->
    <script type="text/javascript" src="../js/bootstrap3/js/bootstrap.js"></script>
    <link rel="stylesheet" href="../js/bootstrap3/css/bootstrap.css">
    <!-- 引入bootstrap table的css、js -->
    <link type="text/css" rel="stylesheet" href="../js/bootstrap-table/bootstrap-table.css">
    <script type="text/javascript" src="../js/bootstrap-table/bootstrap-table.js"></script>
    <script type="text/javascript" src="../js/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
    <!-- 引入bootstrap datetime的css、js -->
    <link type="text/css" rel="stylesheet" href="../js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css">
    <script type="text/javascript" src="../js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="../js/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
</head>
<body>
<div id="toolbar">
</div>
<div class="table" id="bookTable"></div>

</body>
<script>
    $(function(){
        initUserable();
    })
    /**/
    function initUserable(){
        $("#bookTable").bootstrapTable({
            toolbar:'#toolbar',
            url:'../wjs/findlun',
            method:'post',
            contentType:'application/x-www-form-urlencoded',//post请求按照表单方式
            pagination:true,
            pageSize:5,
            pageList:[2,5,6],
            pageNumber:1,
            clickToSelect: true,         //是否启用点击选中行
            sidePagination:'server',        //分页方式：client客户端分页，server服务端分页
            striped:true,          //斑马线
            queryParams:function(){
                return {
                    page:this.pageNumber,
                    rows:this.pageSize
                };
            },
            columns:[
                {field:'xx',title:'商品图片',width : 200,formatter:function (value,row,index){
                        var a="<img src='"+row.productImg+"' width='100' height='90'>";
                        return a;
                    }},
                {field:'bb',title:'商品名称',width : 200,formatter:function (value,row,index){
                        var b="<a >"+row.productName+"</a>";
                        return b;
                    }},
                {field:'neirong',title:'评论内容',width : 200},
                {field:'zhuangtai',title:'评论状态',width : 200,formatter:function (value,row,index){
                       if (value == 1){
                           return "好评";
                       } else if (value == 2){
                           return "差评";
                       } else{
                           return "没评论";
                       }
                    }},
                {field:'productDeliveryTime',width : 200,title:'评论时间',width : 200}
            ]
        })
    }
    $('.date').datetimepicker({
        language: 'zh-CN',//显示中文
        format: 'yyyy-mm-dd hh:ii:ss',//显示格式
        minView: "month",//设置只显示到月份
        initialDate: new Date(),//初始化当前日期
        autoclose: true,//选中自动关闭
        todayBtn: true//显示今日按钮
    });

</script>
</html>